<template>
  <view class="approval-item">
    <CommonHeader>加班申请</CommonHeader>
    <view class="approval-content">
      <CommonInfo approvalType="加班" />
      <view class="input-area">
        <DateSelect label="开始时间" @getSelectDate="getStartTime" />
        <DateSelect label="结束时间" @getSelectDate="getEndTime" />
        <Textarea label="加班事由" @getInputData="getOvertimeReason" />
      </view>
      <ApprovalButton
        :warn="warn"
        :approvalType="'overtime'"
        :procInfo="{
          duration: String(
            Math.floor(
              ((approval.endTime - approval.startTime) / 3600000 / 24) * 100
            ) / 100
          ),
          startTime: String(approval.startTime),
          endTime: String(approval.endTime),
          overtimeReason: approval.overtimeReason,
        }"
      />
    </view>
    <van-toast id="van-toast" />
  </view>
</template>
<script src="./script.js"></script>
<style lang="less" src="./style.less"></style>
